<?php
defined('BY_JYA') or exit('error');
/*
	首页
*/
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
cfc('core')->checklogin();
if($_RQ['op']=='main'){
	
	$member=$this->get('member',array('mid'=>$_SESSION['uid']));
	if(!$member){
		$member=$this->create_member();
	}
	if($member['plate']){
		$member['plate']=json_decode($member['plate'],true);
		$member['plate']=$member['plate']['p'].$member['plate']['c'].$member['plate']['number'];
	}else{
		$member['plate']='请先绑定车牌';
	}
	$member['mobile']=$member['mobile']?:'请绑定手机号';
	$member['activetime']=$member['activetime']?date('Y-m-d H:i:s',$member['activetime']):'待激活';
	$member['message']=$member['message']?:'添加留言，更新动态';
	$member['brandimg']=$member['brandimg']?$this->plugin_resource.'images/brand/'.$member['brandimg']:$this->plugin_resource.'images/cardefault.png';
	$card=$this->get('cards',array('mid'=>$_SESSION['uid']),'number','activetime desc');
	if($card){
		$member['card_number']=$this->card_number($card['number']);
	}
	$setting=$this->plugin_setting('basic');
	$return['member']=$member;
	$return['setting']=$setting;
	exi($return);
}